package  
{
	import flash.display.Bitmap;
	import flash.utils.ByteArray;
	import flash.utils.Dictionary;
	import starling.text.BitmapFont;
	import starling.text.TextField;
	import starling.textures.Texture;
	import starling.textures.TextureAtlas;
	public class Assets 
	{	
		[Embed(source = "../media/graphics/share.png")]
		public static const Share:Class;
		[Embed(source = "../media/graphics/PAUSE.png")]
		public static const PAUSE :Class;
		[Embed(source="../media/graphics/khung ten.png")]
		public static const Khung_ten :Class;
		[Embed(source="../media/graphics/guide_1.png")]
		public static const guide_1 :Class;
		[Embed(source="../media/graphics/guide_2.png")]
		public static const guide_2 :Class;
		[Embed(source="../media/graphics/guide_3.png")]
		public static const guide_3 :Class;
		[Embed(source="../media/graphics/guide_4.png")]
		public static const guide_4 :Class;
		[Embed(source="../media/graphics/guide_5.png")]
		public static const guide_5 :Class;
		
		[Embed(source="../media/graphics/chuthich.png")]
		public static const chuthich :Class;
		[Embed(source="../media/graphics/chuthichkhung.png")]
		public static const chuthichkhung :Class;
		[Embed(source="../media/graphics/chuthichkhung1.png")]
		public static const chuthichkhung1 :Class;
		[Embed(source = "../media/graphics/SOMRAMAT.png")]
		public static const SOMRAMAT :Class;
		[Embed(source = "../media/graphics/Play.png")]
		public static const Play :Class;
		[Embed(source = "../media/graphics/ButtonA.png")]
		public static const Button0 :Class;
		[Embed(source = "../media/graphics/ButtonB.png")]
		public static const Button1 :Class;
		[Embed(source = "../media/graphics/ButtonC.png")]
		public static const Button2 :Class;
		[Embed(source = "../media/graphics/ButtonD.png")]
		public static const Button3 :Class;
		[Embed(source = "../media/graphics/ButtonCorect.png")]
		public static const ButtonCorect :Class;
		[Embed(source = "../media/graphics/ButtonChoose.png")]
		public static const ButtonChoose :Class;
		
		[Embed(source = "../media/graphics/backgroundlv0.jpg")]
		public static const BackGroundlv0 :Class;
		[Embed(source = "../media/graphics/backgroundlv1.jpg")]
		public static const BackGroundlv1 :Class;
		[Embed(source = "../media/graphics/BackGroundlv2.png")]
		public static const BackGroundlv2 :Class;
		[Embed(source = "../media/graphics/BackGroundlv3.png")]
		public static const BackGroundlv3 :Class;
		[Embed(source = "../media/graphics/BackGroundlv4.png")]
		public static const BackGroundlv4 :Class;
		[Embed(source = "../media/graphics/BackGroundlv5.png")]
		public static const BackGroundlv5 :Class;
		[Embed(source = "../media/graphics/BackGroundlv6.png")]
		public static const BackGroundlv6 :Class;
		[Embed(source = "../media/graphics/BackGroundlv7.png")]
		public static const BackGroundlv7 :Class;
		[Embed(source = "../media/graphics/BackGroundlv8.png")]
		public static const BackGroundlv8 :Class;
		[Embed(source = "../media/graphics/BackGroundlv9.png")]
		public static const BackGroundlv9 :Class;
		[Embed(source = "../media/graphics/BackGroundlv10.png")]
		public static const BackGroundlv10 :Class;
		
		
		[Embed(source = "../media/txt/Map_Path.txt", mimeType="application/octet-stream")]
		public static const Txt:Class;
		
		[Embed(source = "../media/graphics/thihuong.png")]
		public static const thihuong :Class;
		[Embed(source = "../media/graphics/thihoi.png")]
		public static const thihoi :Class;
		[Embed(source = "../media/graphics/thidinh.png")]
		public static const thidinh :Class;
		
		[Embed(source = "../media/graphics/LOAN12SUQUAN.png")]
		public static const LOAN12SUQUAN :Class;
		[Embed(source = "../media/graphics/KHUNGHINH.png")]
		public static const KHUNGHINH :Class;
		[Embed(source = "../media/graphics/SONGNHUNGUYET.png")]
		public static const SONGNHUNGUYET :Class;
		[Embed(source = "../media/graphics/NUTKHUNG.png")]
		public static const Khung :Class;
		[Embed(source = "../media/graphics/NUTCHON.png")]
		public static const Chon :Class;
		[Embed(source = "../media/graphics/NUTLUI.png")]
		public static const Lui :Class;
		[Embed(source = "../media/graphics/load1.png")]
		public static const load1 :Class;
		[Embed(source = "../media/graphics/load2.png")]
		public static const load2 :Class;
		[Embed(source = "../media/graphics/load3.png")]
		public static const load3 :Class;
		[Embed(source = "../media/graphics/background1.png")]
		public static const background1 :Class;
		[Embed(source = "../media/graphics/background7.png")]
		public static const background7 :Class;
		[Embed(source = "../media/graphics/background4_4.png")]
		public static const background4 :Class;
		[Embed(source = "../media/graphics/background5.png")]
		public static const background5 :Class;
		[Embed(source = "../media/graphics/background6.png")]
		public static const background6 :Class;
		[Embed(source = "../media/graphics/map.png")]
		public static const map :Class;
		[Embed(source = "../media/graphics/map2.png")]
		public static const map2 :Class;
		[Embed(source = "../media/graphics/flag.png")]
		public static const flag :Class;
		[Embed(source = "../media/graphics/flag2.png")]
		public static const flag2 :Class;
		
		[Embed(source = "../media/graphics/musicoff.png")]
		public static const musicoff :Class;
		[Embed(source = "../media/graphics/musicon.png")]
		public static const musicon :Class;
		[Embed(source = "../media/graphics/soundoff.png")]
		public static const soundoff :Class;
		[Embed(source = "../media/graphics/soundon.png")]
		public static const soundon :Class;
		
		
		
		[Embed(source = "../media/graphics/background2.png")]
		public static const background2 :Class;
		[Embed(source = "../media/graphics/Khungwin.png")]
		public static const Khungwin :Class;
		[Embed(source = "../media/graphics/background3.png")]
		public static const background3 :Class;
		
		[Embed(source = "../media/graphics/CHUA HOAN THANH.png")]
		public static const CHUAHOANTHANH :Class;
		
		[Embed(source = "../media/graphics/SaoItem.png")]
		public static const SaoItem :Class;
		
		[Embed(source = "../media/graphics/DAU HOAN THANH.png")]
		public static const DAUHOANTHANH :Class;
		
		[Embed(source = "../media/graphics/Bartrack.png")]
		public static const Bartrack :Class;
		
		[Embed(source = "../media/graphics/boom.png")]
		public static const boom :Class;
		
		[Embed(source = "../media/graphics/bullet.png")]
		public static const bullet :Class;
		
		[Embed(source = "../media/graphics/bullet-hd.png")]
		public static const bullethd :Class;
		
		
		[Embed(source = "../media/graphics/circle1.png")]
		public static const circle1 :Class;
		
		[Embed(source = "../media/graphics/CloseNormal.png")]
		public static const CloseNormal :Class;
		
		[Embed(source = "../media/graphics/CloseSelected.png")]
		public static const CloseSelected :Class;
		
		[Embed(source = "../media/graphics/coint.png")]
		public static const coint :Class;
		
		[Embed(source = "../media/graphics/HelloWorld.png")]
		public static const HelloWorld :Class;
		
		[Embed(source = "../media/graphics/RallyPoint.png")]
		public static const RallyPoint :Class;
		
		[Embed(source = "../media/graphics/tower.png")]
		public static const tower :Class;
		
		[Embed(source = "../media/graphics/tower-hd.png")]
		public static const towerhd :Class;
		
		[Embed(source = "../media/graphics/arrows1.png")]
		public static const arrow :Class;

		//base build
		[Embed(source = "../media/graphics/BASE_BUILD_NONE.png")]
		public static const BASE_BUILD_NONE :Class;
		
		[Embed(source="../media/fonts/times.ttf", fontFamily="MyFontName", embedAsCFF="false",
			mimeType = "application/x-font",
			fontWeight="normal",
			fontStyle="normal",
			advancedAntiAliasing = "true",
			embedAsCFF="false")]
		public static var MyFont:Class;
		
		

		
		
				
		public static var gameTextures:Dictionary = new Dictionary();
		
		private static var gameTextureAtlas:TextureAtlas;
		
		
		
		[Embed(source = "../media/graphics/solider1.png")]
		public static const AtlasTextureGame:Class;
		
		[Embed(source = "../media/graphics/solider1.xml", mimeType="application/octet-stream")]
		public static const AtlasXmlGame:Class;
		
		//new spritesheet
		private static var gameTexturesFlash: Dictionary = new Dictionary();
		private static var gameTextureAtlasFlash :TextureAtlas;
		
		[Embed(source = "../media/graphics/spritesheetflash.png")]
		public static const SpriteSheetTexture:Class;
		
		
		[Embed(source = "../media/graphics/spritesheetflash.xml", mimeType="application/octet-stream")]
		public static const SpriteSheetXML:Class;
		
		//fix sprite sheet
		private static var fixgameTexturesFlash: Dictionary = new Dictionary();
		private static var fixgameTextureAtlasFlash :TextureAtlas;
		
		[Embed(source = "../media/graphics/fixspritesheet.png")]
		public static const FixSpriteSheetTexture:Class;
		
		
		[Embed(source = "../media/graphics/fixspritesheet.xml", mimeType="application/octet-stream")]
		public static const FixSpriteSheetXML:Class;
		
		public static function getSpriteSheet(): TextureAtlas
		{
			if (gameTextureAtlasFlash == null)
			{
				var texture:starling.textures.Texture = getSpriteSheetTexture("SpriteSheetTexture");
				
				var xml:XML = XML(new SpriteSheetXML());
				gameTextureAtlasFlash = new TextureAtlas(texture, xml);
				
			}
			return gameTextureAtlasFlash;
		}
		
		public static function getSpriteSheetTexture(name:String):starling.textures.Texture
		{
		   if (gameTexturesFlash[name] == undefined)
			{
				var bitmap:Bitmap = new Assets[name]();
				gameTexturesFlash[name] = starling.textures.Texture.fromBitmap(bitmap);
				
			}
			return gameTexturesFlash[name];
		
		}
		
		//get fix sprite sheet
		public static function fixgetSpriteSheet(): TextureAtlas
		{
			if (fixgameTextureAtlasFlash == null)
			{
				var texture:starling.textures.Texture = fixgetSpriteSheetTexture("FixSpriteSheetTexture");
				
				var xml:XML = XML(new FixSpriteSheetXML());
				fixgameTextureAtlasFlash = new TextureAtlas(texture, xml);
				
			}
			return fixgameTextureAtlasFlash;
		}
		
		public static function fixgetSpriteSheetTexture(name:String):starling.textures.Texture
		{
		   if (fixgameTexturesFlash[name] == undefined)
			{
				var bitmap:Bitmap = new Assets[name]();
				fixgameTexturesFlash[name] = starling.textures.Texture.fromBitmap(bitmap);
				
			}
			return fixgameTexturesFlash[name];
		
		}
		//thạnh cuon
		private static var gameTexturesBook: Dictionary = new Dictionary();
		private static var gameTextureAtlasBook :TextureAtlas;
		
		[Embed(source = "../media/graphics/sachcuon.png")]
		public static const SpriteBookTexture:Class;
		
		
		[Embed(source = "../media/graphics/sachcuon.xml", mimeType="application/octet-stream")]
		public static const SpriteBookXML:Class;
		
		public static function getSpriteBook(): TextureAtlas
		{
			if (gameTextureAtlasBook == null)
			{
				var texture:starling.textures.Texture = getSpriteBookTexture("SpriteBookTexture");
				
				var xml:XML = XML(new SpriteBookXML());
				gameTextureAtlasBook = new TextureAtlas(texture, xml);
				
			}
			return gameTextureAtlasBook;
		}
		
		public static function getSpriteBookTexture(name:String):starling.textures.Texture
		{
		   if (gameTexturesBook[name] == undefined)
			{
				var bitmap:Bitmap = new Assets[name]();
				gameTexturesBook[name] = starling.textures.Texture.fromBitmap(bitmap);
				
			}
			return gameTexturesBook[name];
		
		}
		///////////////////
		public static function getAtlas():TextureAtlas
		{
			if (gameTextureAtlas == null)
			{
				var texture:starling.textures.Texture = getTexture("AtlasTextureGame");
				var xml:XML = XML(new AtlasXmlGame());
				gameTextureAtlas = new TextureAtlas(texture, xml);
				
			}
			return gameTextureAtlas;
			
		}
		public static function getTexture(name:String):starling.textures.Texture
		{
			if (gameTextures[name] == undefined)
			{
				var bitmap:Bitmap = new Assets[name]();
				gameTextures[name] = starling.textures.Texture.fromBitmap(bitmap);
				
			}
			return gameTextures[name];
		}
		[Embed(source="../media/fonts/myGlyphs.png")]
		public static const FontTexture:Class;
		
		[Embed(source="../media/fonts/myGlyphs.fnt", mimeType="application/octet-stream")]
		public static const FontXML:Class;
		
		public static function getFont():BitmapFont
		{
			var fontTexture:Texture = Texture.fromBitmap(new FontTexture());
			var fontXML:XML = XML(new FontXML());
			
			var font:BitmapFont = new BitmapFont(fontTexture, fontXML);
			TextField.registerBitmapFont(font);
			
			return font;
		}

		public static function getTxt():ByteArray 
		{
			var txt:ByteArray  = new Txt() as ByteArray;
			
			return txt;
		}
		
		public function Assets() 
		{
			
		}		
	}

}